Uploaded image for project: 'JaxMe'
  1. JaxMe
  2. JAXME-10

PATCH generated TypeHandler, Overly strict property/element ordering

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Resolution: Cannot Reproduce
    • current (nightly)
    • None
    • JaxMe Core
    • None
    • Operating System: Other
      Platform: Other
    • 24322

    Description

      When I create a JAXB object and only set some of the properties I can marshall
      it without a problem, producing neat XML.

      When I then try to unmarshal it I get an exception.

      Apparently elements in the sequence must be set in that order, without
      skipping any so that for

      <element name="prop1">
      <element name="prop2">
      <element name="prop3">

      An object created and marshalled after setting 2 properties
      object.setProp1
      object.setProp2

      will work fine when unmarshalling.

      While
      object.setProp1
      object.setProp3

      will bomb since one was skipped.

      To fix it the xxTypeHandler generated code needs to relax the check by changing

      switch (__state) {
      case 4:
      __state = 5;

      to

      switch (__state) {
      case 0:
      case 3:
      case 4:
      __state = 5;

      (As far as I can tell, that is)

      Attachments

        Activity

          People

            Unassigned Unassigned
            hvendelbo@bluprints.com Henrik Vendelbo
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: